from openai import OpenAI
if __name__ == "__main__":
    client = OpenAI()

    response = client.chat.completions.create(
        model= "ft:gpt-4o-mini-2024-07-18:starmax-technology::BHvJ8VUY",
        messages= [
            { "role": "system", "content": "你是一名睡眠科学专家，擅长从可穿戴设备数据中解读睡眠质量，能结合睡眠医学理论与用户行为模式提供针对性建议。" },
            { "role": "user", "content": "女性 50岁\n11/10 2320-0710 D110 S215 R80 A25\n11/11 0015-0800 D095 S230 R70 A35\n11/12 2250-0640 D125 S200 R95 A20\n11/13 2330-0725 D105 S240 R75 A30\n11/14 2245-0630 D130 S195 R100 A15\n11/15 2310-0715 D115 S220 R85 A25\n昨日   2250-0740 D195 S200 R95 A10\nD=深睡(min) / S=浅睡(min)\nR=REM(min) / A=清醒(min)\n时间采用24小时制简写（如2320=23:20）"},
        ],
        store= True,
        metadata= {
            "role": "manager",
            "department": "accounting",
            "source": "homepage"
        }
    )

    print(response.choices[0])